<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label for="c-type" class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="typeList" item="vo"}
                <label for="row[type]-{$key}"><input id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="channel"}checked{/in} /> {$vo}</label> 
                {/foreach}
            </div>
            <div class="margin" style="margin-left:0;">
                <div class="alert alert-dismissable bg-info">
                    <button type="button" class="close" data-dismiss="alert">×</button>
                    <strong>栏目</strong>: 栏目类型下不可以发布文章,但可以添加子栏目、列表、链接<br>
                    <strong>列表</strong>: 列表类型下可以发布文章,但不能添加子栏目<br>
                    <strong>链接</strong>: 链接类型下不可以发布文章和子级栏目<br>
                </div>
            </div>
        </div>
    </div>
    <div class="form-group tf tf-list tf-channel">
        <label for="c-model_id" class="control-label col-xs-12 col-sm-2">{:__('Model_id')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[model_id]" id="c-model_id" class="form-control">
                {foreach name="modelList" item="vo"}
                <option value="{$vo.id}" data-channeltpl="{$vo.channeltpl}" data-listtpl="{$vo.listtpl}" data-showtpl="{$vo.showtpl}">{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="parent_id" class="control-label col-xs-12 col-sm-2">{:__('上级栏目')}:</label>
        <div class="col-xs-12 col-sm-8">
            <select name="row[parent_id]" data-rule="required" id="parent_id" class="form-control">
                <option value="0">{:__('None')}</option>
                {foreach name="channelList" item="vo"}
                <option value="{$vo.id}" {if $vo.type=='link'}disabled{else /}data-model="{$vo.model_id}"{/if}>{$vo.name}</option>
                {/foreach}
            </select>
        </div>
    </div>
    <div class="form-group">
        <label for="c-name" class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-name" data-rule="required; channelname" class="form-control" name="row[name]" data-toggle="tooltip" title="如果需要多个一次录入多个分类时请换行输入，录入多个时将忽略自定义名称，批量录入格式：分类名称|自定义名称"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-image" class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="input-group">
                <input id="c-image" data-rule="" class="form-control" size="50" name="row[image]" type="text">
                <div class="input-group-addon no-border no-padding">
                    <span><button type="button" id="plupload-image" class="btn btn-danger plupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
                    <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
                </div>
                <span class="msg-box n-right" for="c-image"></span>
            </div>
            <ul class="row list-inline plupload-preview" id="p-image"></ul>
        </div>
    </div>
    <div class="form-group tf tf-channel tf tf-list">
        <label for="c-keywords" class="control-label col-xs-12 col-sm-2">{:__('Keywords')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-keywords" data-rule="" class="form-control" name="row[keywords]" type="text">
        </div>
    </div>
    <div class="form-group tf tf-channel tf tf-list">
        <label for="c-description" class="control-label col-xs-12 col-sm-2">{:__('Description')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-description" data-rule="" class="form-control" name="row[description]"></textarea>
        </div>
    </div>
    <div class="form-group">
        <label for="c-diyname" class="control-label col-xs-12 col-sm-2">{:__('Diyname')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-diyname" data-rule="required(single); diyname" class="form-control" name="row[diyname]" type="text">
        </div>
    </div>
    <div class="form-group tf tf-link">
        <label for="c-outlink" class="control-label col-xs-12 col-sm-2">{:__('Outlink')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-outlink" data-rule="required" class="form-control" name="row[outlink]" type="text">
        </div>
    </div>
    <div class="form-group tf tf-channel">
        <label for="c-channeltpl" class="control-label col-xs-12 col-sm-2">{:__('Channeltpl')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-channeltpl" data-rule="required" class="form-control selectpage" name="row[channeltpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
        </div>
    </div>
    <div class="form-group tf tf-list">
        <label for="c-listtpl" class="control-label col-xs-12 col-sm-2">{:__('Listtpl')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-listtpl" data-rule="required" class="form-control selectpage" name="row[listtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
        </div>
    </div>
    <div class="form-group tf tf-list">
        <label for="c-showtpl" class="control-label col-xs-12 col-sm-2">{:__('Showtpl')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-showtpl" data-rule="required" class="form-control selectpage" name="row[showtpl]" data-source="cms/ajax/get_template_list" data-primary-key="name" data-field="name" type="text">
        </div>
    </div>
    <div class="form-group tf tf-list">
        <label for="c-pagesize" class="control-label col-xs-12 col-sm-2">{:__('Pagesize')}:</label>
        <div class="col-xs-12 col-sm-4">
            <input id="c-pagesize" data-rule="required" class="form-control" name="row[pagesize]" type="number" value="10">
        </div>
    </div>
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="statusList" item="vo"}
                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="normal"}checked{/in} /> {$vo}</label> 
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
